This specification relates to modifying code.
Conventionally, when dealing with untrusted content, e.g., on the web, software behavior is sandboxed in order to minimize the likelihood of security risks from both hardware and software attacks. Typically, sandboxing is performed using a specially-designed language (e.g., JavaScript). However, language-based sandboxing alone does not ensure the safety of highly optimized, dynamic language runtimes that rely on advanced techniques such as Just-In-Time (JIT) compilation and large libraries of native-code support routines. In particular, each new runtime presents a new potential security risk.
One conventional mechanism for providing language-independent sandboxing of software is Software Fault Isolation (SFI). SFI is a traditionally static technique that provides an inductive guarantee of machine code execution safety after performing an analysis of executable code to verify that the code meets a set of safety constraints. However, this guarantee cannot be sustained if the code is modified during runtime.